package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Administrator on 2017/12/9 0009.
 */
@Entity
@Table(name = "T_SYS_USER_DESC", schema = "oa", catalog = "")
public class UserDescEntity extends BaseEntity {

    private String id;
    private String userId;
    private String description;
    private String senderId;
    private String senderName;
    private String noticeDate;
    private String positionAttachName;
    private String positionAttachUrl;

    private UserEntity user;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getNoticeDate() {
        return noticeDate;
    }

    public void setNoticeDate(String noticeDate) {
        this.noticeDate = noticeDate;
    }

    public String getPositionAttachName() {
        return positionAttachName;
    }

    public void setPositionAttachName(String positionAttachName) {
        this.positionAttachName = positionAttachName;
    }

    public String getPositionAttachUrl() {
        return positionAttachUrl;
    }

    public void setPositionAttachUrl(String positionAttachUrl) {
        this.positionAttachUrl = positionAttachUrl;
    }

    public UserEntity getUser() {
        return user;
    }

    public void setUser(UserEntity user) {
        this.user = user;
    }

    public JSONObject getJSONObject(){
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("USER_ID", this.getUserId());
        obj.put("DESCRIPTION", this.getDescription());
        obj.put("SENDER_ID", this.getSenderId());
        obj.put("SENDER_NAME", this.getSenderName());
        obj.put("NOTICE_DATE", this.getNoticeDate());
        obj.put("POSITION_ATTACH_NAME", this.getPositionAttachName());
        obj.put("POSITION_ATTACH_URL", this.getPositionAttachUrl());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_USER_DESC";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("USER_ID", "userId");
        obj.put("DESCRIPTION", "description");
        obj.put("SENDER_ID", "senderId");
        obj.put("SENDER_NAME", "senderName");
        obj.put("NOTICE_DATE", "noticeDate");
        obj.put("POSITION_ATTACH_NAME", "positionAttachName");
        obj.put("POSITION_ATTACH_URL", "positionAttachUrl");
        return obj;
    }
}
